#ifndef RESIZECONTROL_H
#define RESIZECONTROL_H

#include <wx/window.h>
#include <wx/colour.h>

class wxResizeCtrl : public wxWindow {
  public:
    wxResizeCtrl( void );
    wxResizeCtrl( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition,
                  const wxSize& size = wxDefaultSize, long style = wxBORDER_SIMPLE, const wxString& name = wxPanelNameStr );
    wxResizeCtrl( wxWindow *parent, wxWindowID id, wxWindow *child, const wxPoint& pos = wxDefaultPosition,
                  const wxSize& size = wxDefaultSize, long style = wxBORDER_SIMPLE, const wxString& name = wxPanelNameStr );
    ~wxResizeCtrl( void );
    void Create( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
                 long style = wxBORDER_SIMPLE, const wxString& name = wxPanelNameStr );
    void SetChild( wxWindow *Child );
    wxWindow* GetChild( void );
    void SetMargin( int iNewMargin );
    int GetMargin( void );
    void SetColour( wxColour cColour );
    wxColour GetColour( void );
  protected:
    void OnMouseMove( wxMouseEvent& event );
    void OnLeftDown( wxMouseEvent& event );
    void OnLeftUp( wxMouseEvent& event );
    void OnSize( wxSizeEvent& event );
    void OnPaint( wxPaintEvent& event );
    void OnCaptureLost( wxMouseCaptureLostEvent& event );

  private:
    void SetChildSize( wxSize s );
    wxWindow *child;
    int iMargin;
    wxColour cBoxColour;
    bool bResizeTop;
    bool bResizeLeft;
    bool bResizeBottom;
    bool bResizeRight;
    bool bMoving;
    int x;
    int y;
};

#endif
